package com.xiaotao.es.convert;

import com.xiaotao.es.domain.dto.DocumentDto;
import com.xiaotao.es.domain.entity.Document;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingConstants;
import org.mapstruct.Mappings;

/**
 * @author xiaotao
 */
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING, uses = BaseConvert.class)
public interface DocumentConvert {

    @Mappings({
            //@Mapping(target = "abstractContent", source = ""),
            @Mapping(target = "abstractTime", source = "zhaiysj"),
            @Mapping(target = "author", source = "zuoz"),
            //@Mapping(target = "category", source = ""),
            @Mapping(target = "content", source = "docText"),
            @Mapping(target = "name", source = "mingc"),
            //@Mapping(target = "note", source = "")
    })
    DocumentDto base2Dto(Document document);
}
